package srcBlackJack;

public class StateInfo 
{
    Action optimalAction;
    double optimalExpectedReward;
    double deltaFromPrevIteration;
    
    public StateInfo(
            Action optimalAction,
            double optimalExpectedReward,
            double deltaFromPrevIteration) 
    {
        this.optimalAction = optimalAction;
        this.optimalExpectedReward = optimalExpectedReward;
        this.deltaFromPrevIteration = deltaFromPrevIteration;
    }

    public double DeltaFromPrevIteration() 
    {
        return deltaFromPrevIteration;
    }
    
    public Action OptimalAction() 
    {
        return optimalAction;
    }

    public double OptimalExpectedReward() 
    {
        return optimalExpectedReward;
    }

    public void SetDeltaFromPrevIteration(double deltaFromPrevIteration) 
    {
        this.deltaFromPrevIteration = deltaFromPrevIteration;
    }

    public void SetOptimalAction(Action optimalAction) 
    {
        this.optimalAction = optimalAction;
    }

    public void SetOptimalExpectedReward(double optimalExpectedReward) 
    {
        this.optimalExpectedReward = optimalExpectedReward;
    }

    @Override
    public String toString() {
        return String
                .format(
                    "StateInfo [optimalAction=%s, optimalExpectedReward=%s, deltaFromPrevIteration=%s]",
                    optimalAction,
                    optimalExpectedReward,
                    deltaFromPrevIteration);
    }
}
